﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="SedesViewModify.aspx.cs" Inherits="Recursos.WebForm7" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
     <h2>Modificar Sede</h2>

     <asp:GridView ID="GridView1" runat="server" CellPadding="3" GridLines="Horizontal"
   Font-Names="Verdana" Font-Size="10" DataKeyNames="id" OnRowDataBound="gridView_RowDataBound"
   AutoGenerateColumns="false" onrowcancelingedit="GridView1_RowCancelingEdit" 
        onrowediting="GridView1_RowEditing"  onrowupdating="GridView1_RowUpdating" 
       Width="1150px" onrowdeleting="GridView1_RowDeleting" 
         onselectedindexchanged="GridView1_SelectedIndexChanged">
   
   <HeaderStyle BackColor="#336699" ForeColor="White" HorizontalAlign="Left" Height="25" />            
            
   <Columns>
      <asp:CommandField ButtonType="Button" ShowEditButton="true" ShowCancelButton="true"  EditText="Editar" CancelText="Cancelar" UpdateText="Actualizar" />
                 
      <asp:TemplateField>
        <ItemTemplate>
            <asp:Button ID="deleteButton" runat="server" CommandName="Delete" Text="Eliminar"
            OnClientClick="return confirm('Está seguro de que desea eliminar la sede?');" />
        </ItemTemplate>
      </asp:TemplateField>     
                   
      <asp:BoundField DataField="id" HeaderText="" ReadOnly="true" Visible="False" />

      <asp:TemplateField HeaderText="Nombre">
          <ItemTemplate>
              <%# Eval("Nombre")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:TextBox runat="server" ID="Nombre" Text='<%# Eval("Nombre")%>' TextMode="MultiLine" Width="50px"/>
          </EditItemTemplate>
      </asp:TemplateField>                     
      
      <asp:TemplateField HeaderText="Provincia">
          <ItemTemplate>
            <%# Eval("Distrito.Canton.Provincia.Nombre")%>
          </ItemTemplate>
          <EditItemTemplate>
            <asp:DropDownList ID="DropdownProvincia" AutoPostBack="True" 
                    onselectedindexchanged="DropdownProvincia_SelectedIndexChanged" runat="server" DataValueField="id"  DataTextField="Nombre" />
          </EditItemTemplate>
      </asp:TemplateField>         

      <asp:TemplateField HeaderText="Cantón">
          <ItemTemplate>
              <%# Eval("Distrito.Canton.Nombre")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:DropDownList ID="DropdownCanton" AutoPostBack="True" 
                    onselectedindexchanged="DropdownCanton_SelectedIndexChanged" runat="server" DataValueField="id"  DataTextField="Nombre" />
          </EditItemTemplate>
      </asp:TemplateField>
      
      <asp:TemplateField HeaderText="Distrito">
          <ItemTemplate>
              <%# Eval("Distrito.Nombre")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:DropDownList ID="DropdownDistrito"  runat="server" DataValueField="id"  DataTextField="Nombre" />
          </EditItemTemplate>
      </asp:TemplateField>

      <asp:TemplateField HeaderText="Dirección exacta">
          <ItemTemplate>
              <%# Eval("DireccionExacta")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:TextBox runat="server" ID="DireccionExacta" Text='<%# Eval("DireccionExacta")%>' TextMode="MultiLine"/>
          </EditItemTemplate>
      </asp:TemplateField>      
 
    

    </Columns>
            
</asp:GridView>
</asp:Content>
